<template>
  <by-dialog :model-value="modelValue" :show-confirm="false" @close="$emit('update:modelValue',false)">
    <view class="width-full flex-row align-center justify-between">
      <view class="flex-row align-center">
        <image src="/static/wechat.png" class="dialog-icon"/>
        <text class="text-34 color-t1">{{ info.wxNo }}</text>
      </view>

      <by-button width="106rpx" height="44rpx" text="复制" font-size="24rpx" @click="setClipboard(info.wxNo)"/>
    </view>

    <view class="width-full flex-row align-center justify-between margin-top-30">
      <view class="flex-row align-center">
        <image src="/static/phone.png" class="dialog-icon"/>
        <text class="text-34 color-t1">{{ info.contactTel }}</text>
      </view>

      <by-button width="106rpx" height="44rpx" text="复制" font-size="24rpx" @click="setClipboard(info.contactTel)"/>
    </view>
  </by-dialog>
</template>

<script setup lang="ts">
import type { AnyObject } from '@/common/types'
import { setClipboard } from '@/common/util'

interface IProps{
  modelValue: boolean
  watchBack: boolean
  info: AnyObject
}

withDefaults(defineProps<IProps>(), {
  modelValue: false,
  watchBack: true
})

const $emit = defineEmits(['update:modelValue'])
</script>

<style scoped lang="scss">
.dialog-icon{
  width: 56rpx;
  height: 56rpx;
  margin-right: 34rpx;
}
</style>
